import React , { Component,Suspense, lazy  } from 'react';
import { withRouter,NavLink,Switch,Redirect,Route} from 'react-router-dom';

const Home = lazy(() => import('./views/Home'));

const TwoRedux = lazy(() => import('./views/TwoRedux'));
const Zero =lazy(()=>import('./views/zero/view'))
const Ajax =lazy(()=>import('./views/AjaxPage/index'));
const Data =lazy(()=>import('./views/Downup/index'));
const Url =lazy(()=>import('./views/url/index'))
const Xia =lazy(()=>import('./views/下拉刷新/xiala'))

// const Obj = lazy(()=>import('./views/525/Obj'))
const injsx = lazy(()=>import('./views/525/index'))

const fatch = lazy(()=>import('./views/父子通信/App.jsx'))
const redux = lazy(()=>import('./views/reduxlx/index.jsx'))

const Com = lazy(()=>import('./views/528/Com'))
const Coms = lazy(()=>import('./views/528/Com copy'))
class App extends Component {
    render(){
        return (
            <Suspense fallback={<div>Loading...</div>}>
                <Switch>
                    <Route exact path="/" component={Home} />
                    <Route path="/tworedux" component={TwoRedux} />
                    <Route path="/ajax" component={Ajax} />
                    <Route path="/data" component={Data} />
                    <Route path='/zero' component={Zero} />
                    <Route path='/url' component={Url} />
                    <Route path='/xia' component={Xia}></Route>
                    {/* <Route path='/obj' component={Obj} /> */}
                    <Route path='/injsx' component={injsx} />
                    <Route path='/fatch' component={fatch} />
                    <Route path='/redux' component={redux} />
                    <Route path='/com' component={Com}></Route>
                    <Route path='/coms' component={Coms}></Route>
                </Switch>
            </Suspense>
        );
    }
}
export default App;
// redux-thunk